/*
 * CDef.h
 *
 * Created: 30/06/2014 7:36:28 PM
 *  Author: MacGyver
 */ 


#ifndef CDEF_H_
#define CDEF_H_

#include <stdlib.h>

/*****************************************************************************************************************/
/*	GCC/AVR C++ specific macros (Compiler and Linker)
/*****************************************************************************************************************/
__extension__ typedef int __guard __attribute__((mode (__DI__))); 
extern "C" int __cxa_guard_acquire(__guard *); 
extern "C" void __cxa_guard_release (__guard *); 
extern "C" void __cxa_guard_abort (__guard *); 
extern "C" void __cxa_pure_virtual(void); 
extern void * operator new(size_t size);
extern void operator delete(void * ptr);


/*****************************************************************************************************************/
/*	AVR Macros
/*****************************************************************************************************************/
#define EnableGlobalInterrupts()		sei()
#define DisableGlobalInterrupts()		cli()


#define	SET_BYTE_VIA_MASK(current, value, mask) (((current) | (value)) & ~((mask & ~(value))))


#endif /* CDEF_H_ */